package com.zq.learn.akka.typed;

import akka.actor.typed.ActorSystem;

/**
 * AkkaQuickstart
 *
 * @author ZhangQi
 * @date 2020/3/13
 */
public class AkkaQuickstart {
  public static void main(String[] args) {
    /**
     * ActorSystem——akka应用的初始化切入点。ActorSystem必须有一个名字和一个引导Actor。
     * helloakka——名称
     * GreeterMain.create()——引导Actor
     */
    final ActorSystem<GreeterMain.SayHello> greeterMain=ActorSystem.create(GreeterMain.create(),"helloakka");
    greeterMain.tell(new GreeterMain.SayHello("Lime"));

    try{
      System.out.println(">>> Press ENTER to exit <<<");
      System.in.read();
    }catch (Exception e){
      e.printStackTrace();
    }finally {
      greeterMain.terminate();
    }
  }
}
